package oyxTest;

import java.util.Date;
import java.util.List;

import org.junit.Test;

import dao.OyxCollectionMessageDao;
import dao.OyxUser_level_infDao;
import dao.OyxVipUser_IntegralDao;
import dao.impl.OyxCollectionMessageDaoImpl;
import dao.impl.OyxUser_level_infDaoImpl;
import dao.impl.OyxVipUser_IntegralDaoImpl;
import entity.Order_Master;
import entity.OyxVipLevelShow;
import entity.User_Inf;
import entity.User_Point;
import entity.User_level_inf;
import service.OyxUser_levelMessageService;
import service.OyxVipUsermessageService;
import service.impl.OyxUser_levelMessageServiceImpl;
import service.impl.OyxVipUsermessageServiceImpl;

public class TestUserDao {
	OyxVipUser_IntegralDao vuid = new OyxVipUser_IntegralDaoImpl();
	OyxUser_level_infDao ulid= new OyxUser_level_infDaoImpl();
	OyxUser_levelMessageService ulms = new  OyxUser_levelMessageServiceImpl();
	OyxCollectionMessageDao cmd= new OyxCollectionMessageDaoImpl();
	OyxVipUsermessageService vum = new OyxVipUsermessageServiceImpl();
	@Test
	public void getIndentIntegral(){
		//测试通过用户id查询订单积分
		Integer i = vuid.getIndentIntegral(1);
		System.out.println(i);
	}
	@Test
	public void getupdateIndentIntegral(){
		int i = vuid.updateIndentIntegral(1, -88);
		System.out.println(i);
	}
	
	@Test
	public void getAddUser_Point(){
		User_Point user_Point = new User_Point(2,88888,777,null);
		int i = vuid.addUser_Point(user_Point);
		System.out.println(i);
	}
	@Test
	public void getUser_InfMessage(){
		User_Inf user_InfMessage2 = vuid.getUser_InfMessage(1);
		System.out.println(user_InfMessage2);
	}
	
	//通过User_Inf表 用户user_level查询User_level_inf表里的积分等级对应信息
	@Test
	public void getUser_levelMessage(){
		User_level_inf user_levelMessage = ulid.getUser_levelMessage(3);
		System.out.println(user_levelMessage);
	}
	//查询会员id返回会员总数
	@Test
	public void getVipUser_InfSum(){
		Integer vipUser_InfSum = vuid.getVipUser_InfSum();
		System.out.println(vipUser_InfSum);
	}
	//查询会员等级为level的数量
	@Test
	public void getVipUser_InfLevelSumOne(){
		Integer vipUser_InfLevelSumOne = vuid.getVipUser_InfSumLevel(1);
		System.out.println(vipUser_InfLevelSumOne);
	}
	
	@Test
	public void getVipUserLevelShow(){
		List<OyxVipLevelShow> vipUserLevelShow = vuid.getVipUserLevelShow(1,1,2);
		for (OyxVipLevelShow oyxVipLevelShow : vipUserLevelShow) {
			System.out.println(oyxVipLevelShow);
		}
		//查询会员等级人数总个数
		
	}
	@Test
	public void getgetRows(){
		Integer rows = ulms.getRows(1);
		System.out.println(rows);
	}
	
	@Test
	public void getOyxCollectionMessageDaoImpl(){
		List userCollection = cmd.getUserCollection(1, 1, 3);
		for (Object object : userCollection) {
			System.out.println(object);
		}		
	}
	
	@Test
	public void getCollectionRows(){
			Integer collectionRows = cmd.getCollectionRows(1);
			System.out.println(collectionRows);
	}

	@Test
	public void deleteCollection(){
			Integer deleteCollection = cmd.deleteCollection(1, 1);
			System.out.println(deleteCollection);
	}
	@Test
	public void getupdateIndentIntegranew(){
		User_Inf user_InfMessage = vuid.getUser_InfMessage(1);
		System.out.println(user_InfMessage);
	}
	
}

